From: Raghuveer Kasaraneni Date: Sun, 5 Sep 2021 08:33:18 +0000 (+0200) Subject: dash: Fix wrong separator position X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~66^2^2~3 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f0b9a5a85c872a59006aecc33faaa67a6b662555;p=gnome-shell.git dash: Fix wrong separator position The separator position takes drag placeholders into account, but not any removed favorites that are currently animating out. As a result, we may end up with the wrong position and some app icons appear on the wrong side of the separator. To fix, account for all items before the separator that are currently animating out. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3966 Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3799 Part-of: (cherry picked from commit 6fe2c24e229d77b4ffde292f82390010d5ef519a) --- diff --git a/js/ui/dash.js b/js/ui/dash.js index 5037ad5f1..a789f756a 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -821,7 +821,17 @@ export const Dash = GObject.registerClass({ }); this._box.add_child(this._separator); } - let pos = nFavorites + this._animatingPlaceholdersCount; + let pos = nFavorites; + let itemsBeforeSeparator = 0; + for (const item of this._box.get_children()) { + if (item.animatingOut) + pos++; + itemsBeforeSeparator++; + // Assuming only one icon is moved at a time + // Or else we need to track removed favorite items + if (itemsBeforeSeparator > nFavorites) + break; + } if (this._dragPlaceholder) pos++; this._box.set_child_at_index(this._separator, pos);